home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / dev / c / flash-0.4.3.lha / flash-0.4.3 / Lib / font.cc < prev    next >
C/C++ Source or Header  |  1999-02-21  |  2KB  |  101 lines

  1. /////////////////////////////////////////////////////////////
  2. // Flash Plugin and Player
  3. // Copyright (C) 1998 Olivier Debon
  4. // 
  5. // This program is free software; you can redistribute it and/or
  6. // modify it under the terms of the GNU General Public License
  7. // as published by the Free Software Foundation; either version 2
  8. // of the License, or (at your option) any later version.
  9. // 
  10. // This program is distributed in the hope that it will be useful,
  11. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. // GNU General Public License for more details.
  14. // 
  15. // You should have received a copy of the GNU General Public License
  16. // along with this program; if not, write to the Free Software
  17. // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  18. // 
  19. ///////////////////////////////////////////////////////////////
  20. //  Author : Olivier Debon  <odebon@club-internet.fr>
  21. //  
  22.  
  23. #include <string.h>
  24.  
  25. #include "font.h"
  26.  
  27. static char *rcsid = "$Id: font.cc,v 1.6 1999/02/14 22:03:31 olivier Exp $";
  28.  
  29. SwfFont::SwfFont(long id) : Character(FontType, id)
  30. {
  31.     glyphs = 0;
  32.     nbGlyphs = 0;
  33.     name = "Unknown";
  34.     flags = (FontFlags)0;
  35.     lookUpTable = 0;
  36. }
  37.  
  38. SwfFont::~SwfFont()
  39. {
  40.     if (lookUpTable) {
  41.         delete lookUpTable;
  42.     }
  43. }
  44.  
  45. void
  46. SwfFont::setFontFlags(FontFlags f)
  47. {
  48.     flags = f;
  49. }
  50.  
  51. char *
  52. SwfFont::getName()
  53. {
  54.     return name;
  55. }
  56.  
  57. FontFlags
  58. SwfFont::getFlags()
  59. {
  60.     return flags;
  61. }
  62.  
  63. long
  64. SwfFont::getNbGlyphs()
  65. {
  66.     return nbGlyphs;
  67. }
  68.  
  69. Shape  *
  70. SwfFont::getGlyph(long index)
  71. {
  72.     if (index >= nbGlyphs) return 0;
  73.     return &glyphs[index];
  74. }
  75.  
  76. long
  77. SwfFont::getGlyphCode(long index)
  78. {
  79.     if (lookUpTable == 0 || index >= nbGlyphs) return 0;
  80.     return lookUpTable[index];
  81. }
  82.  
  83. void
  84. SwfFont::setFontName(char *str)
  85. {
  86.     name = str;
  87. }
  88.  
  89. void
  90. SwfFont::setFontLookUpTable(long *lut)
  91. {
  92.     lookUpTable = lut;
  93. }
  94.  
  95. void
  96. SwfFont::setFontShapeTable(Shape *shapes, long n)
  97. {
  98.     glyphs = shapes;
  99.     nbGlyphs = n;
  100. }
  101.